package com.zjcloud.academic.domain;

import com.zjcloud.common.annotation.Excel;
import com.zjcloud.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 学期管理对象 ac_semester
 * 
 * @author zjcloud
 * @date 2024-01-01
 */
public class AcSemester extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 学期ID */
    private Long id;

    /** 学期名称 */
    @Excel(name = "学期名称")
    @NotBlank(message = "学期名称不能为空")
    @Size(max = 100, message = "学期名称长度不能超过100个字符")
    private String semesterName;

    /** 学期代码 */
    @Excel(name = "学期代码")
    @NotBlank(message = "学期代码不能为空")
    @Size(max = 50, message = "学期代码长度不能超过50个字符")
    private String semesterCode;

    /** 开始日期 */
    @Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "开始日期不能为空")
    private Date startDate;

    /** 结束日期 */
    @Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    @NotNull(message = "结束日期不能为空")
    private Date endDate;

    /** 学年 */
    @Excel(name = "学年")
    @NotBlank(message = "学年不能为空")
    @Size(max = 20, message = "学年长度不能超过20个字符")
    private String academicYear;

    /** 学期类型(1:春季学期,2:秋季学期,3:夏季学期) */
    @Excel(name = "学期类型", readConverterExp = "1=春季学期,2=秋季学期,3=夏季学期")
    @NotNull(message = "学期类型不能为空")
    private Integer termType;

    /** 状态(0:未开始,1:进行中,2:已结束) */
    @Excel(name = "状态", readConverterExp = "0=未开始,1=进行中,2=已结束")
    private Integer status;

    /** 是否当前学期 */
    @Excel(name = "是否当前学期", readConverterExp = "0=否,1=是")
    private Integer isCurrent;

    /** 备注 */
    @Excel(name = "备注")
    @Size(max = 500, message = "备注长度不能超过500个字符")
    private String remark;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    
    /**
     * 获取学期ID（前端兼容性方法）
     */
    public Long getSemesterId() 
    {
        return id;
    }
    
    /**
     * 设置学期ID（前端兼容性方法）
     */
    public void setSemesterId(Long semesterId) 
    {
        this.id = semesterId;
    }
    public void setSemesterName(String semesterName) 
    {
        this.semesterName = semesterName;
    }

    public String getSemesterName() 
    {
        return semesterName;
    }
    public void setSemesterCode(String semesterCode) 
    {
        this.semesterCode = semesterCode;
    }

    public String getSemesterCode() 
    {
        return semesterCode;
    }
    public void setStartDate(Date startDate) 
    {
        this.startDate = startDate;
    }

    public Date getStartDate() 
    {
        return startDate;
    }
    public void setEndDate(Date endDate) 
    {
        this.endDate = endDate;
    }

    public Date getEndDate() 
    {
        return endDate;
    }
    public void setAcademicYear(String academicYear) 
    {
        this.academicYear = academicYear;
    }

    public String getAcademicYear() 
    {
        return academicYear;
    }
    public void setTermType(Integer termType) 
    {
        this.termType = termType;
    }

    public Integer getTermType() 
    {
        return termType;
    }
    
    /**
     * 获取学期类型（前端兼容性方法）
     */
    public Integer getSemesterType() 
    {
        return termType;
    }
    
    /**
     * 设置学期类型（前端兼容性方法）
     */
    public void setSemesterType(Integer semesterType) 
    {
        this.termType = semesterType;
    }
    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }
    public void setIsCurrent(Integer isCurrent) 
    {
        this.isCurrent = isCurrent;
    }

    public Integer getIsCurrent() 
    {
        return isCurrent;
    }
    public void setRemark(String remark) 
    {
        this.remark = remark;
    }

    public String getRemark() 
    {
        return remark;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("semesterName", getSemesterName())
            .append("semesterCode", getSemesterCode())
            .append("startDate", getStartDate())
            .append("endDate", getEndDate())
            .append("academicYear", getAcademicYear())
            .append("termType", getTermType())
            .append("status", getStatus())
            .append("isCurrent", getIsCurrent())
            .append("remark", getRemark())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}